package com.ruoyi.dingtalk.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.dingtalk.domain.DdDept;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 钉钉部门sql映射
 *
 * @author xueyu
 */
@Mapper
public interface DdDeptMapper extends BaseMapper<DdDept> {

    /**
     * 删除用户部门关联关系
     *
     * @param ddUserId 钉钉用户id
     * @return rows
     */
    int deleteUserDepartmentByuserId(@Param(value = "ddUserId") String ddUserId);

    /**
     * 创建用户和部门的关联关系
     *
     * @param ddUserId 钉钉用户id
     * @param ddDeptId 钉钉部门id
     * @return 影响行数
     */
    int insertUserDepartmentAssociation(@Param(value = "ddUserId") String ddUserId, @Param(value = "ddDeptId") Long ddDeptId);

}
